import ActionTypes from '../config/ActionTypes';
import ActionCodes from '../config/ActionCodes';
import { postFetch } from '../utils/network/request/HttpExtension.js';
import { Actions } from 'react-native-router-flux';
import { createAction } from 'redux-actions';


export function GetNewsCategory() {
    return dispatch => {
        dispatch({type:(ActionTypes.NEWCATEGORYS + ActionTypes.FETCH_LOADING_SUFFIX)});
        postFetch(ActionCodes.newsCategory, {})
            .then(res => {
                dispatch({type:(ActionTypes.NEWCATEGORYS + ActionTypes.FETCH_SUCCESS_SUFFIX),items:res});
            })
            .catch(err=>{
                dispatch({type:(ActionTypes.NEWCATEGORYS + ActionTypes.FETCH_ERROR_SUFFIX)});
            });
    };
}